package com.example.test622.ui.mine



import androidx.lifecycle.lifecycleScope
import com.example.common.BR
import com.example.common.CommonAdapter
import com.example.common.R
import com.example.common.mvi.BaseFragment
import com.example.common.mvi.BaseViewModel
import com.example.net.Dao.DataBase
import com.example.net.entity.RecommonVideoEntity
import com.example.test622.databinding.FragmentMineBinding
import kotlinx.coroutines.launch


class MineFragment : BaseFragment<FragmentMineBinding,BaseViewModel<*,*>>() {
	var list:List<RecommonVideoEntity> = listOf()
	val adapter by lazy {
		CommonAdapter<RecommonVideoEntity>({ com.example.test622.R.layout.recommon to BR.video})
	}
	override fun initView() {
		binding.mineRec.adapter = adapter
		lifecycleScope.launch {
			val db = DataBase.getDataBase(requireContext())
			list = db.videoDao().getAllVideo()
			adapter+=list
		}
	}
	
	override fun initData() {
	
	}
	
}